<template>
    <div class="xui-preview">
        <preview-item @item-click="itemClick" v-for="(item, i) in props.data" :key="i" :data="item" />
    </div>
</template>
<script lang="ts" setup>
import { PropType } from 'vue'
import previewItem from './previewItem.vue'
import { FileExtInfo } from '/@/utils/FileHelper';
    const props = defineProps({
        data: {
            type: Object as PropType<Array<any>>,
            default: ()=>([])
        }
    })
    const emits = defineEmits(['item-click'])
    const itemClick = (extInfo: FileExtInfo) => {
        emits('item-click', extInfo)
    }

</script>
<style lang="scss" scoped>
    .xui-preview {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;                 
    }
</style>